package com.ruoyi.job.task;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.system.api.RemoteTeachingService;
import com.ruoyi.system.api.domain.SysFile;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("teacingTask")
public class TeachingTask
{
    @Autowired
    private RemoteTeachingService remoteTeachingService;

    private static final Logger log = org.slf4j.LoggerFactory.getLogger(TeachingTask.class);
    public void createDailyTask()
    {
        log.debug("开始创建每日任务");
        //远程调用teaching微服务接口创建每日任务
        R<Boolean> result = remoteTeachingService.createDailyTask(SecurityConstants.INNER);
        if (result.getCode()!=R.SUCCESS)
        {
            log.debug("创建每日任务失败");
        }
        log.debug("创建每日任务结束");
    }
}
